-
Notifications
You must be signed in to change notification settings - Fork 2.8k
[ZEPPELIN-905] fix failed notebook import bug #933
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
Looks good to me. |
|
@Leemoonsoo |
| note.getNoteReplLoader().setInterpreters(factory.getDefaultInterpreterSettingList()); | ||
|
|
||
| final Paragraph p = note.addParagraph(); | ||
| String simpleText = "hello world"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How about make p.getReturn() returns non InterpreterResult type object here? Then this test can simulate exception when doing InterpreterResult result = gson.fromJson(resultJson, InterpreterResult.class);
I think easiest way to set arbitrary object to Job.result is making Job.setResult() public.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Leemoonsoo I cannot agree that's the best way to do that..
What if we change type of Job.result into InterpreterResult ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@swkimme
I was trying to say, the test doesn't test import note when p.getReturn() is String.
However this unittest is still good, too. Anyway we didn't have test for import/export function.
About changing Job.result into InterpreterResult, we'll need to consider import note.json created from previous version of Zeppelin. They'll still have Job.result with string type.
|
@Leemoonsoo Do you know why the CI test failed btw? |
|
@swkimme I think this is failing because you are trying to get paragraph result i.e. try having |
| String resultJson = gson.toJson(srcParagraph.getReturn()); | ||
| InterpreterResult result = gson.fromJson(resultJson, InterpreterResult.class); | ||
| newParagraph.setReturn(result, null); | ||
| } catch (Exception e) { /* ignore */ } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A nitpick, but may be we could leave some clues for the person who is going to read it next time.
Instead of stating the fact that we are ignoring exception, we could write the reason or case when\why it happens to be OK to do so i.e
// ignore case when 'result' part of Note consists of exception, instead of actual interpreter results
would make sense, how do you think?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
and, I think we should log the exception
|
@bzz @felixcheung Good idea, updated log and comment! |
| } catch (Exception e) { /* ignore */ } | ||
| } catch (Exception e) { | ||
| // 'result' part of Note consists of exception, instead of actual interpreter results | ||
| logger.info("Paragraph " + srcParagraph.getId() + " has a result with exception."); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
could you ether logger.error() or getStackTrace like here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The exception and message is quite clear so I don't think we do not need trace, then I'm adding the error message!
|
do you think it's ready to be merged now? I belive there was some feedback from @Leemoonsoo as well As for CI failure - it seems like flaky |
|
@swkimme ping on the status of this patch |
### What is this PR for? This PR is fixing import/clone notebook with error result. This PR adds test based on #933. > Note: This issue is one of the [blockers](https://issues.apache.org/jira/browse/ZEPPELIN-889) of 0.6.0 release so should be merged into branch-0.6 before release. ### What type of PR is it? Bug Fix ### What is the Jira issue? [ZEPPELIN-905](https://issues.apache.org/jira/browse/ZEPPELIN-905) ### How should this be tested? When you try to import or clone notebook with error result, it should work. ### Questions: * Does the licenses files need update? No * Is there breaking changes for older versions? No * Does this needs documentation? No Author: Kevin Kim <[email protected]> Author: Mina Lee <[email protected]> Closes #1043 from minahlee/ZEPPELIN-905 and squashes the following commits: 69b8c02 [Mina Lee] Add test for clone notebook with String type result e7af919 [Kevin Kim] stylish code 7bf5d01 [Kevin Kim] log info -> warn, add message d4f6699 [Kevin Kim] log exception 32949bc [Kevin Kim] trigger CI build 803e08a [Kevin Kim] revert implementation c13293f [Kevin Kim] fix test, better implementation 1e45a9e [Kevin Kim] [ZEPPELIN-905] add test a4188be [Kevin Kim] [ZEPPELIN-905] fix failed notebook import bug
### What is this PR for? This PR is fixing import/clone notebook with error result. This PR adds test based on #933. > Note: This issue is one of the [blockers](https://issues.apache.org/jira/browse/ZEPPELIN-889) of 0.6.0 release so should be merged into branch-0.6 before release. ### What type of PR is it? Bug Fix ### What is the Jira issue? [ZEPPELIN-905](https://issues.apache.org/jira/browse/ZEPPELIN-905) ### How should this be tested? When you try to import or clone notebook with error result, it should work. ### Questions: * Does the licenses files need update? No * Is there breaking changes for older versions? No * Does this needs documentation? No Author: Kevin Kim <[email protected]> Author: Mina Lee <[email protected]> Closes #1043 from minahlee/ZEPPELIN-905 and squashes the following commits: 69b8c02 [Mina Lee] Add test for clone notebook with String type result e7af919 [Kevin Kim] stylish code 7bf5d01 [Kevin Kim] log info -> warn, add message d4f6699 [Kevin Kim] log exception 32949bc [Kevin Kim] trigger CI build 803e08a [Kevin Kim] revert implementation c13293f [Kevin Kim] fix test, better implementation 1e45a9e [Kevin Kim] [ZEPPELIN-905] add test a4188be [Kevin Kim] [ZEPPELIN-905] fix failed notebook import bug (cherry picked from commit 50db175) Signed-off-by: Mina Lee <[email protected]>
What is this PR for?
When notebook has a result with Exceptions, it always fail to import. This PR fix it.
What type of PR is it?
Bug Fix
Todos
What is the Jira issue?
https://issues.apache.org/jira/browse/ZEPPELIN-905
How should this be tested?
Create notebook with error, then try to import.
Questions: